<template>
  <section>
    <el-form label-width="80px" size="mini">
      <!--departmentId、name、description、logo、phone、address、contacts、position、data-->
      <el-form-item label="名称">
        <el-input size="mini" v-model="store.name"></el-input>
      </el-form-item>
      <el-form-item label="地址">
        <el-input size="mini" v-model="store.address"></el-input>
      </el-form-item>
      <el-form-item label="联系人">
        <el-input size="mini" v-model="store.contacts"></el-input>
      </el-form-item>
      <el-form-item label="联系方式">
        <el-input size="mini" v-model="store.phone"></el-input>
      </el-form-item>
      <el-form-item label="描述简介">
        <el-input size="mini" v-model="store.description" type="textarea"></el-input>
      </el-form-item>
      <el-form-item label="商铺logo">
        <el-input size="mini" v-model="store.logo"></el-input>
        <img :src="store.logo">
      </el-form-item>
      <el-form-item label="">
        <el-button size="mini" :type="store.id?'success':'primary'" @click="confirmBtn">{{store.id?'保存':'新建'}}</el-button>
      </el-form-item>
    </el-form>
  </section>
</template>

<script>
  import {mapGetters, mapActions, mapMutations} from 'vuex'
  import Vue from 'vue'//后续添加属性，需要vue联动
  import errHandler from '@/assets/errHandler'
  export default {
    name: "newStore",
    props:['store'],
    data(){
      return{}
    },
    watch:{
    },
    created(){
    },
    methods: {
      ...mapActions({
        fetch: 'fetch'
      }),
      confirmBtn(){
        console.log('save----',this.store)
        this.$emit('confirm',this.store)
      },
    }
  }
</script>

<style scoped>

</style>
